package cn.longge.controller;

import cn.longge.entity.Result;
import cn.longge.service.IExamineService;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

@RestController
@RequestMapping("manager/examine")
public class ExamineController {

    @Autowired
    private IExamineService examineService;

    @RequestMapping("index")
    public ModelAndView index(){
        return new ModelAndView("examine/index");
    }

    @RequestMapping("list/{page}/{pageSize}")
    public Result selectByCondition(@PathVariable int page, @PathVariable int pageSize, @RequestBody Map<String,Object> params){
        PageInfo pageInfo = examineService.selectByCondition(page, pageSize, params);
        Result result = new Result();
        result.setObj(pageInfo);
        return result;
    }
}
